<div bsModal #createOrEditModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="createOrEditModal"
    aria-hidden="true" [config]="{ backdrop: 'static' }">
    <div class="modal-dialog modal-xxl">
        <div class="modal-content">
            <form *ngIf="active" #editForm="ngForm" novalidate (ngSubmit)="save()">
                <div class="modal-header">

                    <span style="margin-left:10px;">选择时间：</span>
                    <div style="width:520px;display:inline-block;">
                        <p-calendar [(ngModel)]="selectedDate" name="cal" view="month" dateFormat="yy-mm" [yearNavigator]="true" yearRange="2000:2030"
                            [locale]="calendarHelper.cn"></p-calendar>
                    </div>
                    <button type="button" class="close" (click)="close()" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="m-portlet m-portlet--mobile">
                        <div class="m-portlet__body">

                            <table class="table table-bordered" border="0">
                                <thead>
                                    <tr>
                                        <th colspan="1" rowspan="2" style="vertical-align: middle;">型号</th>
                                        <th colspan="4" style="text-align: center;">费用</th>
                                        <th colspan="8" style="text-align: center;">成本</th>
                                    </tr>
                                    <tr>

                                        <th>暂结价</th>
                                        <th>
                                            合同金额</th>
                                        <th>已收款总额</th>
                                        <th>已结算总额</th>
                                        <th>实际发生成本总额</th>
                                        <th>已结算成本</th>
                                        <th>外协代付</th>
                                        <th>物资代付</th>
                                        <th>代付合计</th>
                                        <th>模拟管理费</th>
                                        <th>全成本</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <ng-container *ngFor="let record of tabledata">
                                        <tr>
                                            <td style="width: 100px !important">

                                                {{ record.modelCode }}
                                            </td>

                                            <td>
                                                <div class="input-group input-group-sm mb-3">
                                                    <input type="number" name="temporaryPrice" class="form-control" aria-label="Sizing example input" [(ngModel)]="record.temporaryPrice"
                                                        aria-describedby="inputGroup-sizing-sm" />
                                                </div>

                                            </td>
                                            <td>
                                                <div class="input-group input-group-sm mb-3">
                                                    <input type="number" name="contractPrice" class="form-control" [(ngModel)]="record.contractPrice" aria-label="Sizing example input"
                                                        aria-describedby="inputGroup-sizing-sm" />
                                                </div>
                                            </td>
                                            <td>
                                                <div class="input-group input-group-sm mb-3">
                                                    <input type="number" name="totalReceipts" class="form-control" [(ngModel)]="record.totalReceipts" aria-label="Sizing example input"
                                                        aria-describedby="inputGroup-sizing-sm" />
                                                </div>
                                            </td>
                                            <td>
                                                <div class="input-group input-group-sm mb-3">
                                                    <input type="number" name="totalSettlement" class="form-control" [(ngModel)]="record.totalSettlement" aria-label="Sizing example input"
                                                        aria-describedby="inputGroup-sizing-sm" />
                                                </div>
                                            </td>
                                            <td>
                                                <div class="input-group input-group-sm mb-3">
                                                    <input type="number" name="actualCost" class="form-control" [(ngModel)]="record.actualCost" aria-label="Sizing example input"
                                                        aria-describedby="inputGroup-sizing-sm" />
                                                </div>
                                            </td>
                                            <td>
                                                <div class="input-group input-group-sm mb-3">
                                                    <input type="number" name="settledCost" class="form-control" [(ngModel)]="record.settledCost" aria-label="Sizing example input"
                                                        aria-describedby="inputGroup-sizing-sm" />
                                                </div>
                                            </td>
                                            <td>
                                                <div class="input-group input-group-sm mb-3">
                                                    <input type="number" name="outsourcePayment" class="form-control" [(ngModel)]="record.outsourcePayment" aria-label="Sizing example input"
                                                        aria-describedby="inputGroup-sizing-sm" />
                                                </div>
                                            </td>
                                            <td>
                                                <div class="input-group input-group-sm mb-3">
                                                    <input type="number" name="materialsPayment" class="form-control" [(ngModel)]="record.materialsPayment" aria-label="Sizing example input"
                                                        aria-describedby="inputGroup-sizing-sm" />
                                                </div>
                                            </td>
                                            <td>
                                                <div class="input-group input-group-sm mb-3">
                                                    <input type="number" name="totalPayment" class="form-control" [(ngModel)]="record.totalPayment" aria-label="Sizing example input"
                                                        aria-describedby="inputGroup-sizing-sm" />
                                                </div>
                                            </td>
                                            <td>
                                                <div class="input-group input-group-sm mb-3">
                                                    <input type="number" name="managementCost" class="form-control" [(ngModel)]="record.managementCost" aria-label="Sizing example input"
                                                        aria-describedby="inputGroup-sizing-sm" />
                                                </div>
                                            </td>
                                            <td>
                                                <div class="input-group input-group-sm mb-3">
                                                    <input type="number" name="totalCost" class="form-control" [(ngModel)]="record.totalCost" aria-label="Sizing example input"
                                                        aria-describedby="inputGroup-sizing-sm" />
                                                </div>
                                            </td>
                                        </tr>
                                    </ng-container>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">
                        {{ l('Cancel') }}
                    </button>
                    <button type="submit" class="btn btn-primary blue" [disabled]="!editForm.form.valid" [buttonBusy]="saving" [busyText]="'保存中...'">
                        <i class="fa fa-save"></i>
                        <span>{{ l('Save') }}</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
